package com.ecs.to_plc_service.utils;

import com.fasterxml.jackson.databind.JsonNode;
import com.fasterxml.jackson.databind.ObjectMapper;

import java.io.IOException;

/**
 * Created by dyh on 2019/4/15.
 */
public class JsonUtils {


    private static final ObjectMapper objectMapper = new ObjectMapper();


    /**
     * json字符串zh转JsonNode对象方法
     */
    public static JsonNode str2JsonNode(String str){
        try {
            return objectMapper.readTree(str);
        }catch (IOException E)
        {
            return null;
        }

    }
}
